package cate.common.table.res.hero.back.row;

import cate.common.table.EExcelNoteField;
import cate.common.table.EExcelRowClass;
import cate.common.table.ERow;
import org.apache.commons.lang3.StringUtils;

@EExcelRowClass(IDTitle = "任务ID")
public class HeroBackStarTaskRow extends ERow {
    @EExcelNoteField(fieldName = "英雄本体返还")
    private String selfRewardStr;

    @EExcelNoteField(fieldName = "狗粮英魂返还")
    private String dogRewardStr;

    @EExcelNoteField(fieldName = "道具返还")
    private String itemRewardStr;

    @EExcelNoteField(fieldName = "魂晶返还")
    private String vialRewardStr;

    public String consumeStr;

    @Override
    public void decode() {
        consumeStr = "";
        if (StringUtils.isNotBlank(selfRewardStr)) {
            consumeStr += selfRewardStr;
        }
        if (StringUtils.isNotBlank(dogRewardStr)) {
            if (StringUtils.isNotBlank(consumeStr)) {
                consumeStr += "#";
            }
            consumeStr += dogRewardStr;
        }
        if (StringUtils.isNotBlank(itemRewardStr)) {
            if (StringUtils.isNotBlank(consumeStr)) {
                consumeStr += "#";
            }
            consumeStr += itemRewardStr;
        }
        if (StringUtils.isNotBlank(vialRewardStr)) {
            if (StringUtils.isNotBlank(consumeStr)) {
                consumeStr += "#";
            }
            consumeStr += vialRewardStr;
        }
    }
}
